# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-string-random
_pkgname=String-Random
pkgver=0.31
pkgrel=5
pkgdesc='Perl module to generate random strings based on a pattern.'
arch=('any')
url='https://metacpan.org/pod/String::Random'
license=('PerlArtistic' 'GPL')
depends=('perl')
makedepends=('perl-module-build')
options=(!emptydirs)
source=("http://search.cpan.org/CPAN/authors/id/S/SH/SHLOMIF/$_pkgname-$pkgver.tar.gz")
sha512sums=('6430fee321ff92142bd24df02145984979cdae2f6cd21c4570fc2ea498b1f308080b25b576cc62dff5d07a7dcb6c61e2108badbe93d41989d6ea92a13ceae6a2')

build() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  /usr/bin/perl Build.PL INSTALLDIRS=vendor
  ./Build
}

package() {
  cd "$_pkgname-$pkgver"

  ./Build install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

